package com.gujianjian.com.config;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class LoggingAdvice implements MethodInterceptor {

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        System.out.println("Before method: " + invocation.getMethod().getName());
        Object result = invocation.proceed(); // 执行原方法
        System.out.println("result: " +result);
        System.out.println("After method: " + invocation.getMethod().getName());
        return result;
    }
}